package de.iceboy.android.goldrush.data;

import java.util.ArrayList;

public class HitSet{
	private ArrayList<Hit> hits;
	
	public HitSet(){
		hits = new ArrayList<Hit>();
	}
	
	public void AddHit(Hit hit){
		hits.add(hit);
	}
	
	public int getPoints(){
		int sum = 0;
		for(Hit h: hits){
			sum += h.getPoints();
		}
		return sum;
	}
	
	public int getCount(){
		return hits.size();
	}
	
	public double getAverage(){
		if(getCount() == 0)
			return 0;
		return getPoints()/getCount();
	}
	
	public Hit getHit(int i){
		return hits.get(i);
	}

	public void clear() {
		hits.clear();
	}

	public void commit() {
		// TODO Auto-generated method stub
		
	}
	
	
	
}
